#!/bin/bash

Hostname=`hostname`

while [ "$machineType" != 'pc' -a "$machineType" != 'sc' ] ; do
   read -p "pc / sc (pc: personal computer, sc: supercomputer): " machineType
done

if [ "$machineType" == 'pc'  ] ; then

   cd MAP1d
   sed -i '2d' Makefile.hostname
   sed -i "1a pcname=$Hostname" Makefile.hostname
   cd ..

   cd MAP2d
   sed -i '2d' Makefile.hostname
   sed -i "1a pcname=$Hostname" Makefile.hostname
   cd ..

   cd MAP3d
   sed -i '2d' Makefile.hostname
   sed -i "1a pcname=$Hostname" Makefile.hostname
   cd ..
fi
